If needed, perform long initialisation tasks here.
info is a dictionary with useful information. Currently it contains
the following values:
"values": a dict mapping index mnemonics to index numbers
The progress indicator can be used to report progress.
'''
self.stemmer = xapian.Stem('english')
self.indexer = xapian.TermGenerator()
self.indexer.set_stemmer(self.stemmer)
def doc(self):
'''
Return documentation information for this data source.
The documentation information is a dictionary with these keys:
name: the name for this data source
shortDesc: a short description
fullDoc: the full description as a chapter in ReST format
'''
return dict(name = 'Package descriptions', shortDesc = "terms extracted from the package descriptions using Xapian's TermGenerator", fullDoc = "\n The Descriptions data source simply uses Xapian's TermGenerator to\n tokenise and index the package descriptions.\n\n Currently this creates normal terms as well as stemmed terms\n prefixed with ``Z``.\n ")
def index(self, document, pkg):
'''
Update the document with the information from this data source.
document is the document to update
pkg is the python-apt Package object for this package